#include "myhead.h"
int main()
{
    struct hostent *result= gethostbyname("www.baidu.com");
    //打印获取官方名字；别名；协议；长度
    printf("%s\n",result->h_name);
    printf("%s\n",*result->h_aliases);//取地址升级，解引用/中括号降级
    printf("%d\n",result->h_addrtype);
    printf("%d\n",result->h_length);
    for(int i=0;result->h_addr_list[i]!=NULL;i++)
    {   
        printf("%s\n",inet_ntoa(*(struct in_addr *)(result->h_addr_list[i])));
    }

}